feat(diagnostics): detect and report coreutils variant#2538
feat(diagnostics): detect and report coreutils variant#2538andrianbalanesq wants to merge 1 commit into
Conversation
Add coreutils detection to the --diagnostics output by probing 'ls --version' and identifying the variant (GNU coreutils, Rust/uutils, or BusyBox). This helps with issue triage when users report bugs that may be caused by coreutils implementation differences. Closes bit-team#2478
buhtz
left a comment
There was a problem hiding this comment.
Hello Adrian,
On behalf of the team, thank you for your contribution and taking the time to improve Back In Time. We appreciate it.
Your PR looks fine. I just have some minor suggestions.
It seems you are a "first-time contributor" to this project. So you might have missed this directive while opening the PR?
The PR will be closed if you haven't introduced yourself as a first time contributor.
Please also have a look at this contribution info: https://github.com/bit-team/backintime/blob/dev/CONTRIBUTING.md#before-you-start
To find out how we usually tread PRs please read "What happens after you opened a PullRequest (PR)?".
Best,
Christian
| @patch('diagnostics._get_extern_versions') | ||
| def test_coreutils_not_found(self, mock_extern): | ||
| """Handle missing ls gracefully.""" | ||
| mock_extern.return_value = '(no ls)' | ||
| # pylint: disable=protected-access | ||
| result = diagnostics._get_coreutils_info() | ||
| self.assertEqual(result, '(no ls)') |
There was a problem hiding this comment.
Hi Adrian,
I see no value in testing for "not found" but feed the return value. Technically it tests the same as test_coreutils_uutils(). But I might miss something here?
What do you think?
|
Hi Christian, thanks for the warm welcome and the review! You make a fair point about I also missed the first-time contributor introduction in the PR description — apologies! Adding it now. Happy to follow the contribution guidelines going forward. |
First-time Contributor Introduction
Hi! I'm Adrian, a developer interested in contributing to backup and system tools. This is my first PR to Back In Time — happy to follow the contribution guidelines and learn the project's conventions.
What
Add coreutils variant detection to the
--diagnosticsoutput. The diagnostics now probels --versionand identify whether the system uses GNU coreutils, Rust/uutils, or BusyBox.Why
Closes #2478.
Different coreutils implementations (GNU, Rust/uutils, BusyBox) have behavioral differences that can affect rsync-based backups, path handling, and flag support. Knowing which variant is installed helps with issue triage and debugging.
How
_get_coreutils_info()incommon/diagnostics.pythat:ls --versionvia the existing_get_extern_versions()helper"GNU coreutils"(e.g.ls (GNU coreutils) 9.4)"BusyBox"(e.g.BusyBox v1.36.1 ...)"uutils"(prefixed withRust/uutils coreutils -for clarity)lsgracefully (returns(no ls))